Skip to content

Add websocket proxying support#116

Open
ameba23 wants to merge 6 commits intomainfrom
peg/proxy-ws-support
Open

Add websocket proxying support#116
ameba23 wants to merge 6 commits intomainfrom
peg/proxy-ws-support

Conversation

@ameba23
Copy link
Collaborator

@ameba23 ameba23 commented Feb 6, 2026

This Implements HTTP/1.1 upgrade tunneling in both proxy server and proxy client so standard WS clients can reach standard WS servers through the proxy.

It add a new --http-mode {http1,http2} flag for the client subcommand (default: http2). This means ws support is opt-in
and the default is http2 support with no ws upgrades.

Server continues to support both h2 and http/1.1; client selects based on flag.

Key changes

  • src/lib.rs: upgrade handling via hyper::upgrade::on, bidirectional stream tunnel, with_upgrades() for server/client HTTP/1.1, and new ProxyClientHttpMode.
  • src/http_version.rs: simplify HttpConnection to a boxed future to allow upgradeable HTTP/1 connection.
  • src/main.rs: new --http-mode flag for client.
  • src/attested_get.rs, src/file_server.rs: pass client mode in helpers/tests.
  • Cargo.toml/Cargo.lock: add hyper-tungstenite dependency.
  • In the proxy-client shared upstream request loop (src/lib.rs), successful responses now set:
    • should_reconnect = resp.status() == 101
  • When should_reconnect is true, the loop intentionally breaks and reconnects, creating a fresh upstream attested connection for subsequent traffic.
  • Log message updated to clarify this is an intentional upstream rotation after upgrade.

Closes #86

@ameba23 ameba23 marked this pull request as draft February 6, 2026 08:35
* main:
  Apply suggestion from @Copilot
  Update .github/workflows/release.yaml
  CI: on release, push docker image
  Pin dcap-qvl to 0.3.10
  Support attestation provider servers which do not wrap messages in an AttestationExchangeMessage
@ameba23 ameba23 marked this pull request as ready for review February 16, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support websocket proxying

1 participant

Comments